﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Xml.Linq;

namespace WPClogger.Server
{
    /// <summary>
    /// Class containing contextual information about an app
    /// </summary>
    [DataContract]
    public class AppContext
    {
        /// <summary>
        /// Gets or sets the App ID
        /// </summary>
        [DataMember]
        public Guid Id { get; set; }
        /// <summary>
        /// Gets or sets the App name
        /// </summary>
        [DataMember]
        public string Name { get; set; }
        /// <summary>
        /// Gets or sets the App version
        /// </summary>
        [DataMember]
        public VersionNumber Version { get; set; }
        /// <summary>
        /// Gets or sets the current OS version
        /// </summary>
        [DataMember]
        public VersionNumber OSVersion { get; set; }
        /// <summary>
        /// Gets or sets the anonymous user ID
        /// </summary>
        [DataMember]
        public string UserId { get; set; }
        /// <summary>
        /// Gets or sets the device ID
        /// </summary>
        [DataMember]
        public byte[] DeviceId { get; set; }
        /// <summary>
        /// Gets or sets the available memory for the device
        /// </summary>
        [DataMember]
        public long DeviceTotalMemory { get; set; }
        /// <summary>
        /// Gets or sets the peak memory usage for the app
        /// </summary>
        [DataMember]
        public long PeakMemoryUsage { get; set; }
        /// <summary>
        /// Gets or sets the current memory usage for the app
        /// </summary>
        [DataMember]
        public long CurrentMemoryUsage { get; set; }
        /// <summary>
        /// Gets or sets any custom information that the app needs to report
        /// </summary>
        [DataMember]
        public XElement CustomInfo { get; set; }
    }
}
